﻿module Sustainalytics.Screening {

    import Common = Sustainalytics.Common;
    import SearchBox = Sustainalytics.SearchBox;

   // export class SearchBoxServiceAdapterRegion implements IScreeningToolSearchBoxService {
    export class SearchBoxServiceAdapterRegion {
        private $q: ng.IQService;
        private $http: ng.IHttpService;
        private $location: ng.ILocationService;

        private notificationFactory: Common.INotificationFactory;
        private staticObjects: Common.IStaticObjects;
        private $rootScope: ng.IScope;

        private ScreeningToolServBackend: ScreeningToolServBackend;

        public constructor(
            $q: ng.IQService,
            $http: ng.IHttpService,
            $location: ng.ILocationService,
            notificationFactory: Common.INotificationFactory,
            staticObjects: Common.IStaticObjects,
            $rootScope: ng.IScope) {

            this.$q = $q;
            this.$http = $http;
            this.notificationFactory = notificationFactory;
            this.staticObjects = staticObjects;
            this.$location = $location;
            this.$rootScope = $rootScope;          

            this.ScreeningToolServBackend = new Screening.ScreeningToolServBackend($q, $http, $location, notificationFactory, staticObjects, $rootScope);
        }

      
      public Search(searchData: any, skip: number, take: number): ng.IHttpPromise<any[]> {         
           
           var criteriaIdPromise: ng.IHttpPromise<CriteriaGenericDto[]> = this.ScreeningToolServBackend.SearchByCriteriaId("Region", searchData, skip, take);                
            return criteriaIdPromise;
        }
    }

    var mod = angular.module(screeningToolModuleName);

    mod.service('SearchBoxServiceAdapterRegion', ['$q', '$http', '$location', 'notificationFactory', 'staticObjects', '$rootScope', SearchBoxServiceAdapterRegion]);

}  